From: Sam Spilsbury Date: Wed, 11 Oct 2017 10:59:19 +0000 (+0200) Subject: keyboard: Handle case where keyboardMonitor is unset X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~929^2~5^2~34 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=19e864ed3b85278ed1a9527ce3c29646328c19ec;p=gnome-shell.git keyboard: Handle case where keyboardMonitor is unset This may be the case where keyboardIndex is -1, which may be the case where either the keyboard monitor hasn't been set yet, or the keyboard is being unmanaged and meta_window_get_monitor returns -1 https://bugzilla.gnome.org/show_bug.cgi?id=788882 --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index e13c7b724..96da88781 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -936,9 +936,11 @@ var Keyboard = new Lang.Class({ }, _relayout() { - if (this.actor == null) - return; let monitor = Main.layoutManager.keyboardMonitor; + + if (this.actor == null || monitor == null) + return; + let maxHeight = monitor.height / 3; this.actor.width = monitor.width; this.actor.height = maxHeight;